Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array: add section for array-specific functions #180

Merged
merged 1 commit into from
Apr 23, 2016
Merged

Conversation

davidchambers
Copy link
Member

Commit message:

This commit also updates type signatures to use Array _ rather than [_] to represent the type of a value which really must be an array.

@Avaq
Copy link
Member

Avaq commented Apr 14, 2016

Maybe it's worth adding a section near ### List pseudotype about how the differences between Array and List are expressed throughout type signatures ([_] for List, Array _ for Array). I had to figure out the difference by reading the source. :)

@davidchambers
Copy link
Member Author

Excellent suggestion, Aldwin! I will do so. :)

@davidchambers davidchambers force-pushed the dc-array branch 2 times, most recently from 3964aef to 98f3856 Compare April 23, 2016 06:20
@davidchambers
Copy link
Member Author

Please have another look at this pull request, @Avaq. :)

@Avaq
Copy link
Member

Avaq commented Apr 23, 2016

I see you switched to using regular brackets to remove ambiguity in nested type signatures. I'm curious about your reasoning. Other than that it looks good to me. :)

@davidchambers
Copy link
Member Author

I see you switched to using regular brackets to remove ambiguity in nested type signatures. I'm curious about your reasoning.

I don't follow, I'm sorry.

I did, for example, change justs :: [Maybe a] -> [a] to justs :: Array (Maybe a) -> Array a. I did so because this function really does require an array of maybes. It would reject, for example, an arguments object of maybes.

@Avaq
Copy link
Member

Avaq commented Apr 23, 2016

Oh, whoops! I must have misread. It seems you were already using regular brackets before. I was talking about how I would write: Either[Error, Array String] where I think you would write Either Error (Array String). I somehow thought you changed between the two styles in this PR, but I was wrong.

@davidchambers
Copy link
Member Author

I like to stay as true to the Haskell notation as possible, so I use Either a b rather than Either[a, b].

You're happy for this pull request to be merged otherwise?

@Avaq
Copy link
Member

Avaq commented Apr 23, 2016

I don't know where I got the square brackets from. I'll probably switch to using your haskellesk notation as well :). The changes look good to me by the way, feel free to merge.

This commit also updates type signatures to use ‘Array _’ rather than
‘[_]’ to represent the type of a value which really must be an array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants